UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4pV2MTnKLiVZKng+BW6d0cYtFODI3yeYgIFxBGzIW+I='
WHERE
key_id = '033169e959de1c6f793726dd1a41dd1bc970f278f6fc9f28223ba147a253920b'
AND (
token = '4pV2MTnKLiVZKng+BW6d0cYtFODI3yeYgIFxBGzIW+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)