UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FhXn/urWIVGN4J1VXR+01HAJARFqTUUic0HrNieg5zM=' 
WHERE 
  key_id = '42a1d303c48efbf7a5c811cc6f2ab1f474a78944280014729e3ec69c278051da' 
  AND (
    token = 'FhXn/urWIVGN4J1VXR+01HAJARFqTUUic0HrNieg5zM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022