UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZBfl2o32/NQNEgncSvvFA3IHucZNvhHyNqkP53Egv7c=' 
WHERE 
  key_id = '752bdce47547a8c595c62ab4bd3aa2b527bcf8906c96c587753acdc4be0825a1' 
  AND (
    token = 'ZBfl2o32/NQNEgncSvvFA3IHucZNvhHyNqkP53Egv7c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020