UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UudxfhnE7Qvwm8K73W2I00uGZiHCAfOPw8Y2BlwkqTE='
WHERE
key_id = '2d465654b7486f2316a06450474aa9a5e16cee00cd9745340941b809d39d078a'
AND (
token = 'UudxfhnE7Qvwm8K73W2I00uGZiHCAfOPw8Y2BlwkqTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)