UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+CBEz8g0TmhM4jMJQcdeKZMMyWgb9GkskR/PfU6X20='
WHERE
key_id = '47d9e67f7c2aac5ec6a36f205ad5d7802f7820ccb6f9d65390a145367749dbe2'
AND (
token = '1+CBEz8g0TmhM4jMJQcdeKZMMyWgb9GkskR/PfU6X20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)