UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9kMezoNwA1N3Jjyac38hJPm29xr7upO2/aV0adB42zA='
WHERE
key_id = '20db10335d3987161ebc2cc58f710072ff48dd2c56c4105b7ec2b9f99802c07b'
AND (
token = '9kMezoNwA1N3Jjyac38hJPm29xr7upO2/aV0adB42zA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)