UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZxvNFYXKcsTjmDX1Cnxno6tUXPxQkAK0r0LGTQVXyIs='
WHERE
key_id = '8666bd853d333729bc26ba82cf54ba97e9f0950cf5f2237f29ef677dd720596a'
AND (
token = 'ZxvNFYXKcsTjmDX1Cnxno6tUXPxQkAK0r0LGTQVXyIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)