UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IQXfyBGnNBzZn/TrQToQv/BiqG2RNPw/SatN+hhe0P4='
WHERE
key_id = 'e4a05020d56ade47c9b15a8a37ea899b738400f7d7662788ce3c4be9052a76f2'
AND (
token = 'IQXfyBGnNBzZn/TrQToQv/BiqG2RNPw/SatN+hhe0P4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)