UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fTMNtRzbmVtCyHPlFf08YKfXur4JIEphA8N2KFiA3iM=' 
WHERE 
  key_id = '4ccf03d60d159f85001b8144daf8ae15f8f9eb6c067a10fe3e4aac82d1cec095' 
  AND (
    token = 'fTMNtRzbmVtCyHPlFf08YKfXur4JIEphA8N2KFiA3iM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044