UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'igAZmQf/AU2YL+2YKooVIB6mMt9+wGo4W8exCREvLhk=' 
WHERE 
  key_id = 'f76c139ea2d3f132456bd9665eb0d96ae2464b80101833a222c3956c608e686e' 
  AND (
    token = 'igAZmQf/AU2YL+2YKooVIB6mMt9+wGo4W8exCREvLhk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048