UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lkFzXgsyyZxH43fUYCWL4vsNnGKXfa+mC4jWMAmcjm4=' 
WHERE 
  key_id = '9f58f32f73d6f4ce493b19534a1f1ab10aa6311a280568dd2b2a4c48a5a850c2' 
  AND (
    token = 'lkFzXgsyyZxH43fUYCWL4vsNnGKXfa+mC4jWMAmcjm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027