UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VOo+3slb5dHlZOg7+ej7BwOeuirTQNdXfog24tYduTY='
WHERE
key_id = 'fb831c7ee9c11f07eaeebb3872748d814e41aaff469499f92725b1e8a2b5da4d'
AND (
token = 'VOo+3slb5dHlZOg7+ej7BwOeuirTQNdXfog24tYduTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)