UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0hxbHVqu2rPi2ueTDaFJhTbsP8pwbaYEnaHPJWojNC4='
WHERE
key_id = '61548323a75cb7bd7f69182a93aa4f019900b414bb46280500730ff30d53ff8f'
AND (
token = '0hxbHVqu2rPi2ueTDaFJhTbsP8pwbaYEnaHPJWojNC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)