UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9xAr2tqw3DU4SoB7ZO7em4IVDNcJT69/q47pCuHxWA4='
WHERE
key_id = '1ab60be7068c3cd9189cb5ed5ca7f0b1876e317a8a40b023eef482c909ff4cf0'
AND (
token = '9xAr2tqw3DU4SoB7ZO7em4IVDNcJT69/q47pCuHxWA4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)