UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q8t8ycZYP0m63Jfy2p8FT7nPH+yTMzpNwgQQXcZ5hkE=' 
WHERE 
  key_id = 'f2d6f3c7e0e7119d202cc4226c880a6b0a5cc434b7521267d8bcf1c648aa9c0c' 
  AND (
    token = 'q8t8ycZYP0m63Jfy2p8FT7nPH+yTMzpNwgQQXcZ5hkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028