UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wK1Zmh0sbIQ5AkcWmI8WsRfAfMTbQw/+se4egrx7Cqo=' 
WHERE 
  key_id = 'f5c3941d8c3fa9d7fe2302a081541232e3b95ed34fc85dda9af8d5568705e396' 
  AND (
    token = 'wK1Zmh0sbIQ5AkcWmI8WsRfAfMTbQw/+se4egrx7Cqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041