UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kkPSHeM4g+T6HqTyRcVP+ril+ZwdHMKLLl2NU/EXYIo='
WHERE
key_id = '0b2c3ef2d693a70d7c627031894ca6af2057149834521dc40a9cca0eb4ff9ca0'
AND (
token = 'kkPSHeM4g+T6HqTyRcVP+ril+ZwdHMKLLl2NU/EXYIo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)