UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YpMPRZGznZTuyFKUEy9483qmdNQWFLobY4nlK37WXpM=' 
WHERE 
  key_id = 'a3e84546bebe5998427cf95d5661eac8863e81dbfc62236ebfa68bafbdf9e597' 
  AND (
    token = 'YpMPRZGznZTuyFKUEy9483qmdNQWFLobY4nlK37WXpM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030