UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G32YbYklKvrgrGGvtT8Y6y2xYLQlNDaHt/C+7RDvVac='
WHERE
key_id = '45f421f9400b88a16abe020a79732dcad5c6c27ece61c276c17247c3ab626e80'
AND (
token = 'G32YbYklKvrgrGGvtT8Y6y2xYLQlNDaHt/C+7RDvVac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)