UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'emU+ELRm3BjUpNEyWFd/JUD/IZXQZMafLTS1bcjSi/o=' 
WHERE 
  key_id = '8c8a44ba13e40ba5ae09cb9b0e2fd614835168f7fdb0fc75f36aef700c157764' 
  AND (
    token = 'emU+ELRm3BjUpNEyWFd/JUD/IZXQZMafLTS1bcjSi/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037