UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jTh695NIIIB7ezAgbqbjIjwb+GVtiuzJT4PcMpmtRRM=' 
WHERE 
  key_id = '64810dbb69f7ae8b3f97b96729f8aa1d0da7426cb917e61ff340bbfb0c4b4a2e' 
  AND (
    token = 'jTh695NIIIB7ezAgbqbjIjwb+GVtiuzJT4PcMpmtRRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042