UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lw3ZAh/75hxMe5HjC0PHBHINDF/thpN4LoBFcx88mv4='
WHERE
key_id = '2304fe1a5d9e3ae63e35abb0c387a1a52a251098e28e6a2d415d093d807aeea1'
AND (
token = 'Lw3ZAh/75hxMe5HjC0PHBHINDF/thpN4LoBFcx88mv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)