UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AUXFSFf44MZ6ZOTrT3pUwdUGDoIJ4RgIENZYmb06kHg='
WHERE
key_id = '40d0b62dcf784794be3d39a5e019d037a600826fe8e1b05fd378eb6893ce39e6'
AND (
token = 'AUXFSFf44MZ6ZOTrT3pUwdUGDoIJ4RgIENZYmb06kHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)