UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bdOGNFBGTMqIilQ5NCRFD8nl1PzFpIUEPHzf2Ei/PjE='
WHERE
key_id = '6d6d0bcfc573c3529e4865ccf669ce4aa806e715b3c8fe4f6fb9158101eaaa4a'
AND (
token = 'bdOGNFBGTMqIilQ5NCRFD8nl1PzFpIUEPHzf2Ei/PjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)