UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5VlPSkncFQiIw46NYTphBYiNM9kfEQdxBFiISkDC5MU=' 
WHERE 
  key_id = '7885ce35ccd1da495a28a1cec15ac4462da8ffd7f6e7dd54cfbe9b9d15b70d11' 
  AND (
    token = '5VlPSkncFQiIw46NYTphBYiNM9kfEQdxBFiISkDC5MU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034