UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7PwwT0GkjRlFrAtCv8wXNYGyhmBG7RwfkF6BJKABlu8='
WHERE
key_id = 'dcbea0ff93fe05ed73743dcd22b0f1097dbde8558cb4514efcfd773b434a8d27'
AND (
token = '7PwwT0GkjRlFrAtCv8wXNYGyhmBG7RwfkF6BJKABlu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)