UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OZS8b3EWxKuiGilEZcYflZYvB/p8+xVDovRH3CbrV/o='
WHERE
key_id = '75927429173c3cf6ba1359435a8ef48f0868658270886e3087c55147af43fe41'
AND (
token = 'OZS8b3EWxKuiGilEZcYflZYvB/p8+xVDovRH3CbrV/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)