UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4t/0A5pOAmcjmyGyMg3eACWaFbPAG0pxrP3C/eCrWE0='
WHERE
key_id = 'b867319ea34be6f68ac9311093b130d6c5702dcd2d03d9ec3e3ba2affe77dab4'
AND (
token = '4t/0A5pOAmcjmyGyMg3eACWaFbPAG0pxrP3C/eCrWE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)