UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tp+6dIYTq2bFOA38FKsham8q1FbBFy2ZXbhbzdiFgnw=' 
WHERE 
  key_id = '2c3a94df9ae2ae6356ba572b251038bcc62fcc9650fd8c6dfdc68d66b2e94762' 
  AND (
    token = 'tp+6dIYTq2bFOA38FKsham8q1FbBFy2ZXbhbzdiFgnw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035