UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BoDsFfGlu2YRgzbYBWbmYrxat9a1p2D9H2Y9sJMeH/s=' 
WHERE 
  key_id = 'bd68809b7ad30ea2b0c1aeacc3b85404ecfb268a047af15c24eb973a6fc8ef91' 
  AND (
    token = 'BoDsFfGlu2YRgzbYBWbmYrxat9a1p2D9H2Y9sJMeH/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026