UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6BcEUuJkbPuvfKEpTbefOUa+AiHt6sj7DLsp/lxXeMY='
WHERE
key_id = '9f82e9160ad0d693478b9734461afdb90aff551b98b5ae7e3a75f3bb25eb3b29'
AND (
token = '6BcEUuJkbPuvfKEpTbefOUa+AiHt6sj7DLsp/lxXeMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)