UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qOx33Re0eve1fFGNS0dOAANDbu4JwpYu7JJNB0hPfbw='
WHERE
key_id = '65d991feab2139c9303f12a4d0c621ef53a1e152e374a2022268e4938d7dc6a1'
AND (
token = 'qOx33Re0eve1fFGNS0dOAANDbu4JwpYu7JJNB0hPfbw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)