UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WPUP+V6mbFoLmOxbm1L7alx4z2aZ3O4aHE3vnprLI1A='
WHERE
key_id = 'db799559abe12f85a6b3531b50dca55b5440c52f3ac3578a65e19aa5b19e58a8'
AND (
token = 'WPUP+V6mbFoLmOxbm1L7alx4z2aZ3O4aHE3vnprLI1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)