UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lngdEZnQAuZ+Ce1XBnHpHBStKba5rWI5DajnuUyzsFM=' 
WHERE 
  key_id = '99c974ddf7da4d23b6119a9fdc8390d58e4608af03fccfe3559904dd875250e9' 
  AND (
    token = 'lngdEZnQAuZ+Ce1XBnHpHBStKba5rWI5DajnuUyzsFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031