UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LJtBEFLZWSSR7e+bBpAN0EqTvVG8URA4WYaFZ8n4+rE=' 
WHERE 
  key_id = '377e91cb27361fd7f1c75cebd0ba7241fcdc17c4e4219282f45b33e57a5da943' 
  AND (
    token = 'LJtBEFLZWSSR7e+bBpAN0EqTvVG8URA4WYaFZ8n4+rE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036