UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AKjZhp9afaaS9jzYn/TusMJ8RDaMcdsI/W69nOCFFts=' 
WHERE 
  key_id = 'fc8b3086d309a2fe02f210a97b6d9f8ef42ef48b2d37bb6fcd23fc31822273ab' 
  AND (
    token = 'AKjZhp9afaaS9jzYn/TusMJ8RDaMcdsI/W69nOCFFts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021