UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'znRCoXEByLE66NI2DNWimqPRIFXnBwaC2ZnbP1UHN2E='
WHERE
key_id = '476bd3cd9c9eda9055de492bad5ffba3cb9cd0d04ba9a76bec8fd83cec900810'
AND (
token = 'znRCoXEByLE66NI2DNWimqPRIFXnBwaC2ZnbP1UHN2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)