UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vYH7WIa/dIW+o5Q3StVcHTEvfCKstzNZhfSpwzXAAAE=' 
WHERE 
  key_id = 'd65f4f750fffbe921023b3b71c8e6dbc380e935c74ef21b0ecf3d3a7eb623e88' 
  AND (
    token = 'vYH7WIa/dIW+o5Q3StVcHTEvfCKstzNZhfSpwzXAAAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037