UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5eRe6IjCHHrzULvuINWo1U0am9olKFTUT2pUS+iKHg='
WHERE
key_id = '7de65483d38ecfc437198aa9264f10f544f46f48de10777f27d0a326ab2e6d74'
AND (
token = 'G5eRe6IjCHHrzULvuINWo1U0am9olKFTUT2pUS+iKHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)