UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XObgQNuMpYXk8Sb7n63DPdxZd7G7awj6WhQaCQx/CPE='
WHERE
key_id = '101ddb6c0179838fb9b6215b98699d9bef6f8a4cb6a40e6f4a77de484202a810'
AND (
token = 'XObgQNuMpYXk8Sb7n63DPdxZd7G7awj6WhQaCQx/CPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)