UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lwFRw4DETTtEzPCwSRDSmro6haMj54GmBb2piwbTgWg=' 
WHERE 
  key_id = '6ff43f328e0a36a1a2d1398b6e736ec23dfc5a4d4803d8d3c417fe562a98645e' 
  AND (
    token = 'lwFRw4DETTtEzPCwSRDSmro6haMj54GmBb2piwbTgWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029