UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OvnRxDCmeYLV42H0lxLERZ83eokWR+TwDkyUeQkAt9Y='
WHERE
key_id = 'b495c84af04c31ed2ee6aea9c81c6bb22b13a7bd96ceb22f42c18c169e6f4d12'
AND (
token = 'OvnRxDCmeYLV42H0lxLERZ83eokWR+TwDkyUeQkAt9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)