UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fF7G/tHR+OL+QnKjgdRqvykc226gyxyffqC32y7O5G0=' 
WHERE 
  key_id = '562af53480e528e26d4e2a234f1e79c8fd4674b1cd11342e53dce5040bf31e7f' 
  AND (
    token = 'fF7G/tHR+OL+QnKjgdRqvykc226gyxyffqC32y7O5G0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021