UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'izoKGiXRJ4itfWWEtpzQx8zjQWc1Nzyoc6vEMmJndYI='
WHERE
key_id = '79f1ce271a7fc9821d4873a124bb59828f7e10391ba346df53302b5cf1190f83'
AND (
token = 'izoKGiXRJ4itfWWEtpzQx8zjQWc1Nzyoc6vEMmJndYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)