UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tJgakEGb8dY4SkO+1dCHA/llhRcWXfsyEqxopISrEcY='
WHERE
key_id = '3e9ccad01c89a79a1e599d688fc5ad39c39cf24cd7a0e2554407c33d00f52e6f'
AND (
token = 'tJgakEGb8dY4SkO+1dCHA/llhRcWXfsyEqxopISrEcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)