UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q3WdvzaI2fCtc5FLpPJBJB2AKAfqlJoHMHlWpqwKbJE='
WHERE
key_id = '35f8658edb8533b907525ab9ea351f3c39b2eb072d3f6df3a6e9be831d23dc59'
AND (
token = 'Q3WdvzaI2fCtc5FLpPJBJB2AKAfqlJoHMHlWpqwKbJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)