UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bTZer3zj2EYz7ddQT+Whwpm0oYhrhW5uZjCYDPWtu14='
WHERE
key_id = '4d5d5b7c8872ea6a13324f65646c15b3e18ebdd8e5439d7ede37facad2a40cb8'
AND (
token = 'bTZer3zj2EYz7ddQT+Whwpm0oYhrhW5uZjCYDPWtu14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)