UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZLDNmYU6QdyQmEq5LbCKkKUeWw6Kjba+RTNqe7VPIoY='
WHERE
key_id = 'ddfdf04f4a2f5ebfdbe02fb5dcdc6e2cbf06f977988518d982833eaa66313a77'
AND (
token = 'ZLDNmYU6QdyQmEq5LbCKkKUeWw6Kjba+RTNqe7VPIoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)