UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+JatmWRTdppmmigH90Q0/n7mSRRifPh46D5TkheK01g='
WHERE
key_id = 'dc679bcd54deb98082f09f1b92f4d028295a86e3db34f8a501a450e869adb40a'
AND (
token = '+JatmWRTdppmmigH90Q0/n7mSRRifPh46D5TkheK01g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)