UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nBWSKaT6d2h2PWbHkC8j3sQYE1Mwz8G1K9qK/rnkJUo='
WHERE
key_id = '5b399172059de408e9cea66543ea7f884f68ccd9753e6d7a7e17e848180898d3'
AND (
token = 'nBWSKaT6d2h2PWbHkC8j3sQYE1Mwz8G1K9qK/rnkJUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)